<template>
  <div>
   <my-header></my-header>
   <my-footer></my-footer>
   <my-goods v-for="i in list" :key="i.goods_id"
   
   :boj='i'></my-goods>
   <my-count :boj='i'></my-count>
  </div>
</template>

<script>
import MyCount from './components/MyCount.vue'
import MyFooter from './components/MyFooter.vue'
import MyGoods from './components/MyGoods.vue'
import MyHeader from './components/MyHeader.vue'

export default {
  components: { MyHeader, MyGoods, MyFooter, MyCount },
  
data(){
  return{
    list:[]
  }
},


    created(){
    // 不必在自己引入axios变量, 而是直接使用全局属性$axios
    this.$axios({
      url: "/api/cart"
    }).then(res => {
      // console.log(res);
      this.list = res.data.list
      // console.log(this.list);
    })
  }
 
}
</script>

<style>

</style>
